// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Axios from 'axios'

// import $ from 'jquery'
import { Popup } from 'mint-ui';
import { InfiniteScroll } from 'mint-ui';
import { Tabbar, TabItem } from 'mint-ui';
import { Navbar } from 'mint-ui';
import { Button } from 'mint-ui';
import { Cell } from 'mint-ui';
import { Spinner } from 'mint-ui';
import { TabContainer, TabContainerItem } from 'mint-ui';
import { Switch } from 'mint-ui';
import { Radio } from 'mint-ui';
import { Field } from 'mint-ui';
import { Badge } from 'mint-ui';
import { Indicator } from 'mint-ui';

Vue.use(Indicator);
Vue.component(Badge.name, Badge);
Vue.component(Field.name, Field);
Vue.component(Radio.name, Radio);
Vue.component(Switch.name, Switch);
Vue.component(TabContainer.name, TabContainer);
Vue.component(TabContainerItem.name, TabContainerItem);
Vue.component(Spinner.name, Spinner);
Vue.component(Cell.name, Cell);
Vue.component(Button.name, Button);
Vue.component(Navbar.name, Navbar);
Vue.component(Tabbar.name, Tabbar);
Vue.component(TabItem.name, TabItem);
Vue.use(InfiniteScroll);
Vue.component(Popup.name, Popup);
Vue.config.productionTip = false


router.beforeEach((to,from,next)=>{
  if(to.meta.title){
    document.title = to.meta.title
  }
  next()
})
Axios.defaults.baseURL = 'https://yokapp.mynatapp.cc'
Vue.prototype.$axios = Axios;

Axios.defaults.withCredentials = true;
// Axios.defaults.headers.cookie = "openid=" + getCookie("openid")
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: {
    App
  },
  template: '<App/>'
})
